#include"myQueque.h"

myCirQueue::myCirQueue(int capcity) {
	this->size = 0;
	queue = vector<int>(capcity, 0);
	rear = 0;
	front = 0;
	size = 0;
}
bool myCirQueue::push(int val) {
	if (size != queue.size()){
		queue[rear] = val;
		rear = (++rear) % size;
		size++;
		return true;
	}
	return 0;
}
bool myCirQueue::pop() {
	if (size >0) {
		++front;
		size++;
		return true;
	}
	return false;
}
int myCirQueue::getFront() {
	if (size > 0) {
		return queue[front];
	}
	throw "";
}
int myCirQueue::getRear() {
	if (size > 0) {
		return queue[rear-1];
	}
	throw "";
}